# Contributor: John Regan <john@jrjrtech.com>
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
pkgname=s6-networking
pkgver=2.7.0.1
pkgrel=0
pkgdesc="skarnet.org's UCSPI TCP and TLS tools, access control tools, and network time management utilities."
url=https://skarnet.org/software/s6-networking/
arch="all"
license="ISC"
options="!check"
makedepends="skalibs-dev>=2.14 execline-dev s6-dev>=2.12 s6-dns-dev bearssl bearssl-dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://skarnet.org/software/s6-networking/s6-networking-$pkgver.tar.gz"

build() {
	./configure \
		--enable-shared \
		--enable-static \
		--disable-allstatic \
		--prefix=/usr \
		--libdir=/usr/lib \
		--libexecdir="/usr/lib/$pkgname" \
		--with-dynlib=/lib \
		--enable-ssl=bearssl
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

doc() {
	default_doc
	mkdir -p "$subpkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
}

static() {
	default_static
	rmdir -p "$pkgdir"/usr/lib/"$pkgname" || :
}

sha512sums="
3074c24e833f6f19bfc016c264963457f8a9df6b07bab1c0a58dc4cd0b464371051d1d5af0d5ac5544751ffa18514e2f078f329249fe97955657a3aab9ebaa99  s6-networking-2.7.0.1.tar.gz
"
